package com.loukou.lkt.lkt.enums;

public enum PoPurchaseReturnOrderStateEnum {

	STATE_NEW( 0, "新建退货单" ),	
	
	STATE_DEPART_PASS( 1, "部门审核通过" ),
	
	STATE_DEPART_UNPASS( 2, "部门审核未通过" ),
	
	STATE_FINANCE_PASS( 3, "财务审核通过" ),
	
	STATE_FINANCE_UNPASS( 4, "财务审核未通过" ),
	
	STATE_SUPPLIER_RECEIVED( 5,"供应商已收货"),
	
	STATE_CLOSED( 6,"已完成退货"),
	
	STATE_CANCELED( 7,"已取消退货单"),
	
	STATE_NOTIFIED( 8,"已通知仓库");
	
	private int state;
	private String name;
	
	PoPurchaseReturnOrderStateEnum( int state, String name) {
		this.state = state;
		this.name = name;
	}
	
	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public static PoPurchaseReturnOrderStateEnum parseStateEnum(int state) {
		for (PoPurchaseReturnOrderStateEnum stateEnum : PoPurchaseReturnOrderStateEnum.values()) {
			if(stateEnum.state == state){
				return stateEnum;
			}
		}
		return STATE_NEW;
	}
}
